package com.dimong.www.loan.ui.adapter.holder;


import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.dimong.loan.sdk.ui.adapter.BaseRecyclerViewHolder;
import com.dimong.www.loan.R;
import com.dimong.www.loan.bean.ProdBean;
import com.dimong.loan.sdk.utils.GlideUtil;

public class LoadHotRecommendHolder extends BaseRecyclerViewHolder {
    private ImageView item_prod_pic;
    private TextView item_prod_name;
    private TextView item_prod_apply_num;
    private  TextView item_prod_tag;
    private TextView item_prod_lending_time_str;
    private TextView item_prod_rate;
    private TextView item_prod_rate_type;
    private TextView item_prod_limit;
    private TextView item_prod_limit_type;
    public LoadHotRecommendHolder(Context context, ViewGroup parent) {
        super(context, R.layout.item_hot_recommend, parent);

        item_prod_pic = findViewById(R.id.item_prod_pic);
        item_prod_name = findViewById(R.id.item_prod_name);
        item_prod_apply_num =findViewById(R.id.item_prod_apply_num);
        item_prod_tag = findViewById(R.id.item_prod_tag);
        item_prod_lending_time_str = findViewById(R.id.item_prod_lending_time_str);
        item_prod_rate = findViewById(R.id.item_prod_rate);
        item_prod_rate_type = findViewById(R.id.item_prod_rate_type);
        item_prod_limit = findViewById(R.id.item_prod_limit);
        item_prod_limit_type = findViewById(R.id.item_prod_limit_type);
    }

    @Override
    public void setData(Object object) {
        super.setData(object);
        if (object instanceof ProdBean) {
            ProdBean prodBean = (ProdBean) object;
            GlideUtil.loadImg(mContext, prodBean.getLogo(), item_prod_pic);
            item_prod_name.setText(prodBean.getLoan_name());
            item_prod_apply_num.setText(prodBean.getApply_num());
            item_prod_tag.setText(prodBean.getTag());
            item_prod_lending_time_str.setText(prodBean.getLending_time_str()+"放款");
            item_prod_rate.setText(prodBean.getRate());
            item_prod_rate_type.setText("/"+prodBean.getRate_type());
            item_prod_limit.setText(prodBean.getLimit_str());
            item_prod_limit_type.setText(prodBean.getLimit_type());
        }
    }
}
